<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // bind ,call ,apply之间的区别
        /* bind 是改变函数的上下文执行环境，不会马上执行
            被call 和apply绑定的函数会马上执行
        */
        function go(name,age){
            console.log(this.name+':'+this.age)
            console.log(name)
            console.log(age)
        }
        var li={
            name:'元谋人',
            age:23
        }
        var zhang={
            name:"袁天罡",
            age:10000
        }
        go.apply(li,["li",24])
        go.call(zhang,"zhang",111)
        </script>
</body>
</html>